const { DataTypes } = require('sequelize')
const seq = require('../utils/seq')
const moment = require('moment')

/**
 *类别id：id uuid
  名称：name string
  用户id：uid 用户表外键 uuid
  备注：remark string
  状态：status Boolean
  创建时间：ctime string
  更新时间：mtime string
 */

module.exports = seq.define('collect_type', {
  id: {
    type: DataTypes.UUID,
    primaryKey: true,
    allowNull: false,
    defaultValue: DataTypes.UUIDV4,
    commet: '收藏类别id'
  },
  name: {
    type: DataTypes.STRING,
    allowNull: false,
    comment: '名称'
  },
  uid: {
    type: DataTypes.UUID,
    allowNull: false,
    comment: '用户表id'
  },
  remark: {
    type: DataTypes.STRING,
    comment: '备注'
  },
  status: {
    type: DataTypes.BOOLEAN,
    allowNull: false,
    defaultValue: true,
    comment: '状态'
  },
  ctime: {
    type: DataTypes.STRING,
    defaultValue: moment().format('YYYY-MM-DD HH:mm:ss'),
    comment: '创建时间'
  },
  mtime: {
    type: DataTypes.STRING,
    defaultValue: moment().format('YYYY-MM-DD HH:mm:ss'),
    comment: '更新时间'
  }
})